import axios from '@/utils/axios'

const addMchPackageApi = '/sp_admin/biz_package/add' // 新增
const updateMchPackageApi = '/sp_admin/biz_package/update' // 编辑
const mchPackageDetailApi = '/sp_admin/biz_package/info' // 详情
const mchPackageListApi = '/sp_admin/biz_package/list' // 套餐
const mchPackagePageApi = '/sp_admin/biz_package/page' // 套餐
const mchPackageFeaturesApi = '/sp_admin/biz_package/getPackageFeatures' // 权限
const delMchPackageApi = '/sp_admin/biz_package/remove' // 删除

/**
 * @desc 新增
 */
export const addMchPackage = ({ data }) => {
  return axios.post(addMchPackageApi, data)
}

/**
 * @desc 编辑
 */
export const updateMchPackage = ({ data }) => {
  return axios.post(updateMchPackageApi, data)
}

/**
 * @desc 详情
 */
export const mchPackageDetail = ({ params }) => {
  return axios({
    url: mchPackageDetailApi,
    method: 'get',
    params: params
  })
}

/**
 * @desc 列表
 */
export const mchPackageList = () => {
  return axios.get(mchPackageListApi)
}

/**
 * @desc 列表分页
 */
export const mchPackagePage = ({ data }) => {
  return axios.post(mchPackagePageApi, data)
}

/**
 * @desc 权限
 */
export const mchPackageFeatures = () => {
  return axios.get(mchPackageFeaturesApi)
}

/**
 * @desc 删除
 */
export const delMchPackage = ({ params }) => {
  return axios({
    url: delMchPackageApi,
    method: 'delete',
    params: params
  })
}
